Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relayer address to module callbacks #206

Merged
merged 6 commits into from
Jun 9, 2021

Conversation

ethanfrey
Copy link
Contributor

Description

Implements cosmos/ibc#579

Adds the relayer sdk.AccAddress to OnRecvPacket, OnAcknowledgementPacket, OnTimeoutPacket callbacks for IBCModule.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK pending approval in cosmos/ibc

Needs changelog and ideally an entry in docs/migrations/v43 but I can add these changes later

@ethanfrey
Copy link
Contributor Author

Thanks for the quick review.

I updated the CHANGELOG, but I am not sure how to maintain the migration file, and would be happy if you could handle that

@codecov-commenter
Copy link

codecov-commenter commented May 31, 2021

Codecov Report

Merging #206 (efe932c) into main (8320447) will decrease coverage by 0.08%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
- Coverage   80.26%   80.17%   -0.09%     
==========================================
  Files         109      109              
  Lines        6485     6497      +12     
==========================================
+ Hits         5205     5209       +4     
- Misses        925      929       +4     
- Partials      355      359       +4     
Impacted Files Coverage Δ
modules/apps/transfer/module.go 60.68% <ø> (ø)
modules/core/keeper/msg_server.go 64.00% <50.00%> (-1.09%) ⬇️

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending TimeoutOnClose changes as well

@@ -527,6 +538,11 @@ func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*c
func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

relayer, err := sdk.AccAddressFromBech32(msg.Signer)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdityaSripal this was already implemented.

Timeout and TimeoutOnClose messages both call the same module callback, so I had to update them to get the code to compile

@colin-axner
Copy link
Contributor

This pr is outdated based on recent discussion, correct? A generalized fee wouldn't pass the relayer address into the application module callbacks?

@ethanfrey
Copy link
Contributor Author

This is not outdated.

The implementation or general fee payment may use application logic (with decorators for example). Or may be baked in a lower level. I personally think we will likely use the module interface with some decorator.

A few people requested that it be possible for applications to incentivize directly (like the DEX paying for incoming orders, or some altruistic pool sponsoring one app/channel). This is absolutely needed for that use-case.

@ethanfrey
Copy link
Contributor Author

cosmos/ibc#579 is merged.

Are there any other changes requested on this before merge?

@colin-axner
Copy link
Contributor

Are there any other changes requested on this before merge?

I just wanted to add a little note in the migration docs. I didn't have the permissions to push directly to this branch

@ethanfrey
Copy link
Contributor Author

Are there any other changes requested on this before merge?

I just wanted to add a little note in the migration docs. I didn't have the permissions to push directly to this branch

@colin-axner I merged your PR. Thanks for the notes.

I still can't find out why all my branches on forks do not allow pushing from maintainers. (This goes for other repos too) I have looked before but not found the proper switch

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @ethanfrey

@colin-axner
Copy link
Contributor

I still can't find out why all my branches on forks do not allow pushing from maintainers. (This goes for other repos too) I have looked before but not found the proper switch

Very odd. Well, opening a pr to your fork works for now 👍

@colin-axner colin-axner enabled auto-merge (squash) June 9, 2021 15:23
@colin-axner
Copy link
Contributor

@ethanfrey could you update to the latest commit of main? Then it should auto merge

@colin-axner colin-axner merged commit 2548ab5 into cosmos:main Jun 9, 2021
@ethanfrey ethanfrey deleted the expose-packet-signer branch June 9, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants